package com.zlf.feign;


import com.zlf.po.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

//指定调用的购物车微服务名
//@FeignClient注解的fallback属性指定熔断降级方法
@FeignClient(name="cart-server",fallback=CartFeignClientCallBack.class)
public interface CartFeignClient {
    @GetMapping("/CartController/listCart/{userId}/{businessId}")
    public CommonResult<List> listCart(
            @PathVariable("userId") String userId,
            @PathVariable("businessId") Integer businessId);
    @DeleteMapping("/CartController/cleanCart/{userId}/{businessId}")
    public CommonResult<Integer> cleanCart(
            @PathVariable("userId") String userId,
            @PathVariable("businessId") Integer businessId) throws Exception;
}